    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
        <%@include file="../common.jsp"%>

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>编辑资讯信息</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="${ctx}common/frame/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}common/css/gobal.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}common/css/animate.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}backstage/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="${ctx}backstage/css/createActive.css" media="all">
    
</head>
<body>


<div class="larry-fluid larry-wrapper">

    <div class="layui-row lay-col-space20">
        <div class="layui-cos-xs12 layui-col-sm12 layui-col-md12 layui-col-lg8">
            <section class="larry-body animated fadeInRightBig">
                <div class="larry-body-content clearfix">
                    <form class="layui-form" action="" method="post">
                    
                    	<div class="layui-form-item" id="biglei">
				            <label class="layui-form-label">图文信息</label>
					        <div class="layui-input-block">
					        <select name="keyvalue" id="keyvalue" class="layui-input layui-select">
					             <option value="0">请选择</option>
					             <c:forEach items="${requestScope.news}" var="news">
					                 <option value="${news.keyvalue }" <c:if test="${menu.keyvalue eq news.keyvalue }">selected</c:if> >${news.title}</option>
					             </c:forEach>
					        </select>
					        </div>
				        </div>
                    	<div class="layui-form-item">
                            <label class="layui-form-label">菜单标题</label>
                            <div class="layui-input-block">
                                <input type="text" name="name" value="${menu.name}" lay-verify="required" autocomplete="off"
                                       class="layui-input">
                            </div>
                        </div>
                        
                        <div class="layui-form-item">
						    <label class="layui-form-label">事件类型</label>
						    <div class="layui-input-block">
						      <input type="radio" name="type" value="view" title="链接" <c:if test="${menu.type=='view' || menu.type=='' || menu.type==null}">checked</c:if> >
						      <input type="radio" name="type" value="click" title="点击" <c:if test="${menu.type=='click' }">checked</c:if> >
						    </div>
						 </div>
						 
                       <div class="layui-form-item" id="url">
                            <label class="layui-form-label">链接地址</label>
                            <div class="layui-input-block">
                                <input type="text" name="urlvalue" value="${menu.urlvalue}"  autocomplete="off"
                                       class="layui-input">
                            </div>
                        </div>
                        
						<input type="hidden" name="submenu_id" value="${menu.submenu_id }">
						<input type="hidden" name="submenu_pid" value="${submenu_pid }">

						<div class="layui-form-item">
                           <label class="layui-form-label"></label>
                           <div class="layui-input-block" style="height: 50px;">
                               
                           </div>
                        </div>

                        <div class="layui-form-item" style="text-align: center;">
                            <button class="layui-btn" lay-submit="" lay-filter="ok">确定</button>
                            <button type="layui-btn" id="cancle" class="layui-btn layui-btn-primary">取消</button>

                        </div>
                    </form>


                </div>
            </section>
        </div>
    </div>
</div>

<script type="text/javascript" src="${ctx}common/frame/layui/layui.js"></script>

<script>
    var agid;
    layui.config({
        base: "${ctx}common/larrylib/",
        version: '201708031'
    }).use(['jquery', 'form', 'upload'], function () {
        var $ = layui.jquery, form = layui.form, upload = layui.upload;
        var width = $(document).width();
        var height = $(document).height();
        
        
       
        //监听提交
        form.on("submit(ok)", function (data) {
        	
            var loginLoading = top.layer.msg('提交中，请稍候...', {icon: 16, time: false, shade: 0.8});
            $.ajax({
                url: '${ctx}menu/doupdatechilde',
                type: 'post',
                async: false,
                data: data.field,
                dataType: "json",
                success: function (data) {
                    if (data.state == "true") {
                       // window.setInterval(function(){},1500);
                       top.layer.msg(data.res, {icon: 6});
                       	var index = parent.layer.getFrameIndex(window.name); //当前iframe层的索引
                        parent.layer.close(index); //再执行关闭
                        parent.location.reload();//刷新父页面
                        top.layer.msg(data.res, {icon: 6});
                        return true;
                    } else {
                        top.layer.msg(data.res, {icon: 5});
                        return false;
                    }
                    top.layer.close(loginLoading);
                }, error: function () {
                    top.layer.msg("系统数据处理异常！", {icon: 2});
                    top.layer.close(loginLoading);
                    return false;
                }
            });
        });

        //取消
        $("#cancle").click(function () {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index); //再执行关闭
        });


    });

</script>
</body>
</html>